home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
pc
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
CAppendiceSearch.as
< prev
next >
Wrap
Text File
|
2007-11-08
|
29KB
|
856 lines
class CAppendiceSearch
{
var mLemma = null;
var mContributo = null;
var mProspettiva = null;
var mSearchInitialized = false;
var mProspettiveInitialized = false;
static var GATEWAY_URL = "http://127.0.0.1/flashservices/gateway.php";
static var CONTRIBUTI_URL = "http://127.0.0.1/xxi/contributi/";
static var EMBEDDEDIMAGE_URL = "http://127.0.0.1/xxi/formule/";
static var PROSPETTIVE_URL = "http://127.0.0.1/xxi/prospettive/";
static var EXPORTHTML_URL = "htmlexport.php";
static var SERVICE_NAME = "CAppendiceBrowserServlet_a4";
static var CREDITS_URL = "credits.swf";
static var HELP_URL = "help.swf";
static var MENU_PROSPETTIVE_URL = "prospettive.swf";
var mSearchType = "mostra";
var mSearchData = null;
var mPagePrefetch = 4;
function CAppendiceSearch(root)
{
this.mRoot = root;
this.mSearchInitialized = false;
this.mProspettiveInitialized = false;
this.init();
}
function InitSearch(inForce)
{
if(this.mSearchInitialized == false || inForce == true)
{
this.mSearchInitialized = true;
this.mRoot.searchTypeGroup.dispatchEvent({type:"click",target:_root.searchTypeGroup});
}
}
function InitMenuProspettive(inForce)
{
if(this.mProspettiveInitialized == false || inForce == true)
{
_global.gAlert.ShowAlert("","Inizializzazione del menu prospettive in corso","EMPTY",10);
var _loc3_ = this.mService.DoGetProspettiveList();
_loc3_.__set__responder(new mx.rpc.RelayResponder(this,"handleDoGetProspettiveList","handleError"));
}
}
function handleDoGetProspettiveList(re)
{
this.mRoot.mc_MenuProspettive.InitMenuProspettive(re.result);
this.mProspettiveInitialized = true;
_global.gAlert.Hide();
}
function init()
{
mx.remoting.debug.NetDebug.initialize();
this.mHistory = new CHistory();
this.mTornaArray = new Array();
this.mContributo = new CAppendiceContributo(CAppendiceSearch.CONTRIBUTI_URL);
this.mProspettiva = new CAppendiceProspettiva(CAppendiceSearch.PROSPETTIVE_URL);
this.mLemma = new CAppendiceLemma(CAppendiceSearch.CONTRIBUTI_URL,CAppendiceSearch.PROSPETTIVE_URL);
if(_global.gDVD == true)
{
this.mService = new CAppendiceOfflineService(this);
}
else
{
this.mService = new mx.remoting.Service(CAppendiceSearch.GATEWAY_URL,null,CAppendiceSearch.SERVICE_NAME);
}
this.initUI();
}
function SearchResultsIconManager(itemObj)
{
if(itemObj == undefined)
{
return undefined;
}
switch(itemObj.icon)
{
case "L":
return "lemmaIcon";
case "S":
return "sottolemmaIcon";
case "R":
return "rinvioIcon";
default:
return "emptyIcon";
}
}
function doSearch(searchWords, excludeWords, searchParm)
{
var _loc3_ = "La ricerca inserita è in corso di esecuzione.";
if(this.mSearchType == "mostra")
{
_loc3_ = "Caricamento dell\'indice alfabetico in corso.";
}
_global.gAlert.ShowAlert("",_loc3_,"EMPTY",10);
var _loc4_ = this.mService.DoVociSearch(searchWords,excludeWords,searchParm);
_loc4_.__set__responder(new mx.rpc.RelayResponder(this,"handleDoVociSearch","handleError"));
var _loc7_ = this.mService.DoContributiSearch(searchWords,excludeWords,searchParm);
_loc7_.__set__responder(new mx.rpc.RelayResponder(this,"handleDoContributiSearch","handleError"));
_loc7_ = this.mService.DoProspettiveSearch(searchWords,excludeWords,searchParm);
_loc7_.__set__responder(new mx.rpc.RelayResponder(this,"handleDoProspettiveSearch","handleError"));
}
function doGetLemma(inLemma, inCallback)
{
var _loc3_ = this.mService.DoGetLemma(inLemma.mId);
_loc3_.__set__responder(new mx.rpc.RelayResponder(this,inCallback,"handleError"));
_global.gAlert.ShowAlert("","Caricamento della voce \"" + inLemma.mTitolo + "\" in corso..","EMPTY",10);
}
function doGetContributo(inContributo, inCallbackHandler)
{
var _loc3_ = this.mService.DoGetContributo(inContributo.mId);
_loc3_.__set__responder(new mx.rpc.RelayResponder(this,inCallbackHandler,"handleError"));
_global.gAlert.ShowAlert("","Caricamento del contributo \"" + inContributo.mTitolo + "\" in corso..","EMPTY",10);
}
function doGetProspettiva(inProspettiva, inCallbackHandler)
{
var _loc3_ = this.mService.DoGetProspettiva(inProspettiva.mId);
_loc3_.__set__responder(new mx.rpc.RelayResponder(this,inCallbackHandler,"handleError"));
_global.gAlert.ShowAlert("","Caricamento della prospettiva \"" + inProspettiva.mTitolo + "\" in corso..","EMPTY",10);
}
function doLookUp(inStr)
{
_global.gAlert.ShowAlert("","Caricamento dell\'indice alfabetico in corso.","EMPTY",10);
var _loc3_ = this.mService.DoLookUp(inStr);
_loc3_.__set__responder(new mx.rpc.RelayResponder(this,"handleDoLookUp","handleError"));
}
function handleDoVociSearch(re)
{
this.mRoot.mc_SearchResult.SetResults("voci",re.__get__result());
}
function handleDoContributiSearch(re)
{
this.mRoot.mc_SearchResult.SetResults("contributi",re.__get__result());
_global.gAlert.Hide();
}
function handleDoProspettiveSearch(re)
{
this.mRoot.mc_SearchResult.SetResults("prospettive",re.__get__result());
_global.gAlert.Hide();
}
function handledoGetContributo(re)
{
if(re.__get__result() && re.__get__result().id)
{
this.mContributo.InitFromResult(re.__get__result());
this.OpenContributiWindow(this.mContributo);
}
_global.gAlert.Hide();
}
function handledoGetContributoPreview(re)
{
if(re.__get__result() && re.__get__result().id)
{
this.mContributo.InitFromResult(re.__get__result());
this.ShowContributiPreview(this.mContributo);
}
_global.gAlert.Hide();
}
function handledoGetProspettiva(re)
{
if(re.__get__result())
{
this.mProspettiva.InitFromResult(re.__get__result());
this.OpenProspettiveWindow(this.mProspettiva,"ricerca");
}
_global.gAlert.Hide();
}
function handledoGetProspettivaPreview(re)
{
if(re.__get__result())
{
this.mProspettiva.InitFromResult(re.__get__result());
this.ShowProspettivePreview(this.mProspettiva);
}
_global.gAlert.Hide();
}
function handledoGetLemma(re)
{
if(re.__get__result())
{
this.mLemma.InitFromResult(re.__get__result());
this.OpenLemmaWindow(this.mLemma);
}
_global.gAlert.Hide();
}
function handledoGetLemmaPreview(re)
{
if(re.__get__result())
{
this.mLemma.InitFromResult(re.__get__result());
this.ShowLemmaPreview(this.mLemma);
}
_global.gAlert.Hide();
}
function handleDoLookUp(re)
{
var _loc3_ = re.__get__result();
if(_loc3_)
{
var _loc5_ = this.mRoot.mc_SearchResult.GetTabList("voci");
_loc5_.vPosition = parseInt(_loc3_.voci);
var _loc4_ = this.mRoot.mc_SearchResult.GetTabList("contributi");
_loc4_.vPosition = parseInt(_loc3_.contributi);
_loc4_ = this.mRoot.mc_SearchResult.GetTabList("prospettive");
_loc4_.vPosition = parseInt(_loc3_.contributi);
}
_global.gAlert.Hide();
}
function handleError(rs)
{
this.mRoot.btStartSearch.enabled = true;
_global.gAlert.ShowAlert("","Impossibile connettersi al Database","OK",10);
return undefined;
}
function MostraLemma(id, tipo, titolo, inFrom, inDoubleClick, inStatus)
{
if(this.mLemma.mId != id)
{
this.mLemma.NewLemma(id,tipo,titolo);
}
this.mLemma.mFrom = inFrom;
this.mLemma.mStatus = inStatus;
if(inDoubleClick)
{
if(this.mLemma.mInitialized == false)
{
this.doGetLemma(this.mLemma,"handledoGetLemma");
}
else
{
this.OpenLemmaWindow(this.mLemma);
}
}
else if(this.mLemma.mInitialized == false)
{
this.doGetLemma(this.mLemma,"handledoGetLemmaPreview");
}
else
{
this.ShowLemmaPreview(this.mLemma);
}
}
function MostraProspettiva(id, tipo, titolo, inFrom, inDoubleClick)
{
if(this.mProspettiva.mId != id)
{
this.mProspettiva.NewProspettiva(id,tipo,titolo);
}
this.mProspettiva.mFrom = inFrom;
if(inDoubleClick)
{
if(this.mProspettiva.mFile == "")
{
this.doGetProspettiva(this.mProspettiva,"handledoGetProspettiva");
}
else
{
this.OpenProspettiveWindow(this.mProspettiva);
}
}
else if(this.mProspettiva.mFile == "")
{
this.doGetProspettiva(this.mProspettiva,"handledoGetProspettivaPreview");
}
else
{
this.ShowProspettivePreview(this.mProspettiva);
}
}
function MostraContributo(id, tipo, titolo, inFrom, inDoubleClick)
{
if(this.mContributo.mId != id)
{
this.mContributo.NewContributo(id,tipo,titolo);
}
this.mContributo.mFrom = inFrom;
if(inDoubleClick)
{
if(this.mContributo.mFile == "")
{
this.doGetContributo(this.mContributo,"handledoGetContributo");
}
else
{
this.OpenContributiWindow(this.mContributo);
}
}
else if(this.mContributo.mFile == "")
{
this.doGetContributo(this.mContributo,"handledoGetContributoPreview");
}
else
{
this.ShowContributiPreview(this.mContributo);
}
}
function GetSearchData()
{
var _loc2_ = new Object();
_loc2_.caseSensitive = this.mRoot.cbCaseSensitive.selected;
_loc2_.fullTextSearch = this.mRoot.rbFullSearch.selected;
_loc2_.wholeWord = this.mRoot.cbWholeWords.selected;
_loc2_.allWords = this.mRoot.rbAndSearch.selected;
_loc2_.searchType = this.mSearchType;
_loc2_.searchedText = this.mRoot.ibSearchInput.text;
return _loc2_;
}
function GetSearchDataStr()
{
var _loc2_ = undefined;
var _loc3_ = this.GetSearchData();
_loc2_ = "";
_loc2_ += String(!_loc3_.caseSensitive ? 0 : 1);
_loc2_ += "," + String(!_loc3_.fullTextSearch ? 0 : 1);
_loc2_ += "," + String(!_loc3_.wholeWord ? 0 : 1);
_loc2_ += "," + String(!_loc3_.allWords ? 0 : 1);
_loc2_ += "," + String(!_loc3_.searchType ? 0 : 1);
return _loc2_;
}
function onSearch()
{
var _loc5_ = undefined;
var _loc10_ = StringUtils.trim(this.mRoot.ibSearchInput.text);
var _loc11_ = StringUtils.trim(this.mRoot.ibExcludeWords.text);
this.mSearchData = this.GetSearchData();
if(this.mSearchType == "mostra")
{
_loc5_ = _root.gNormalize.Normalize(_loc10_);
var _loc13_ = StringUtils.trim(_loc5_.text);
this.doLookUp(_loc13_);
}
else
{
if(_loc10_ == "" && _loc11_ == "")
{
_global.gAlert.ShowAlert("","Inserire la parola da ricercare","OK",10);
return undefined;
}
var _loc12_ = this.GetSearchDataStr();
var _loc6_ = "";
var _loc9_ = _loc10_.split(" ");
var _loc4_ = 0;
while(_loc4_ < _loc9_.length)
{
_loc5_ = _root.gNormalize.Normalize(_loc9_[_loc4_]);
if(_loc4_ > 0)
{
_loc6_ += ",";
}
_loc6_ += StringUtils.trim(_loc5_.text);
_loc4_ = _loc4_ + 1;
}
var _loc7_ = "";
var _loc8_ = _loc11_.split(" ");
_loc4_ = 0;
while(_loc4_ < _loc8_.length)
{
_loc5_ = _root.gNormalize.Normalize(_loc8_[_loc4_]);
if(_loc4_ > 0)
{
_loc7_ += ",";
}
_loc7_ += StringUtils.trim(_loc5_.text);
_loc4_ = _loc4_ + 1;
}
this.doSearch(_loc6_,_loc7_,_loc12_);
}
}
function onSearchTypeChange(evtObj)
{
this.clearUI();
this.mRoot.mc_SearchResult.clearUI();
this.mSearchType = evtObj.target.selection.data;
if(this.mSearchType == "mostra")
{
this.mRoot.mc_TabMostra._visible = true;
this.mRoot.btnStartSearch.setState(false);
this.mRoot.mc_SearchResult.SetState("mostra");
this.doSearch("","",this.GetSearchDataStr());
}
else
{
this.mRoot.mc_TabMostra._visible = false;
this.mRoot.btnStartSearch.setState(true);
this.mRoot.mc_SearchResult.SetState("cerca");
}
}
function onPreviewClick(evtObj)
{
if(evtObj.where == "image")
{
if(evtObj.tipo == "P" && this.mProspettiva.mFile != "")
{
this.mProspettiva.mFrom = "ricerca";
this.mProspettiva.mStatus = null;
this.OpenProspettiveWindow(this.mProspettiva);
}
else if(this.mContributo.mFile != "")
{
this.mContributo.mFrom = "ricerca";
this.mContributo.mStatus = null;
this.OpenContributiWindow(this.mContributo);
}
}
else if(evtObj.where == "text" && this.mLemma)
{
this.mLemma.mFrom = "ricerca";
this.mLemma.mStatus = null;
this.OpenLemmaWindow(this.mLemma);
}
}
function onResultTabChange(evtObj)
{
this.mRoot.mc_Preview.Hide();
this.SetWhere("searchResult_" + evtObj.tab);
this.UpdateToolbarButton();
}
function onHandleWindowMessage(evtObj)
{
if(evtObj.action == "open")
{
this.SetWhere(evtObj.windowName);
}
else
{
var _loc2_ = "";
if(this.mRoot.mc_ZoomWindow._visible == true)
{
_loc2_ = "zoom";
}
else if(this.mRoot.mc_ProspettiveViewer._visible == true)
{
_loc2_ = "prospettive";
}
else if(this.mRoot.mc_MenuProspettive._visible == true)
{
_loc2_ = "menuProspettive";
}
else if(this.mRoot.mc_ContributiWindow._visible == true)
{
_loc2_ = "contributi";
}
else if(this.mRoot.mc_LemmaViewer._visible == true)
{
_loc2_ = "lemma";
}
else
{
_loc2_ = "searchResult_" + this.mRoot.mc_SearchResult.ActiveTab();
}
this.SetWhere(_loc2_);
}
this.UpdateToolbarButton();
}
function UIEnableClickOnLabel()
{
this.mRoot.rbSearchOnTitle.mUseAlphaInSetHitArea = true;
this.mRoot.rbFullSearch.mUseAlphaInSetHitArea = true;
this.mRoot.rbOrSearch.mUseAlphaInSetHitArea = true;
this.mRoot.rbAndSearch.mUseAlphaInSetHitArea = true;
this.mRoot.rbFullSearch.mUseAlphaInSetHitArea = true;
this.mRoot.cbWholeWords.mUseAlphaInSetHitArea = true;
this.mRoot.cbCaseSensitive.mUseAlphaInSetHitArea = true;
this.mRoot.rbShowFullIndex.mUseAlphaInSetHitArea = true;
this.mRoot.rbSearchIndex.mUseAlphaInSetHitArea = true;
}
function initUI()
{
this.UIEnableClickOnLabel();
if(_global.gDVD == true)
{
this.mRoot.mc_Esci.onPress = mx.utils.Delegate.create(this,this.onEsci);
this.mRoot.mc_Iconizza.onPress = mx.utils.Delegate.create(this,this.onIconizza);
}
else
{
this.mRoot.mc_Esci._visible = false;
this.mRoot.mc_Iconizza._visible = false;
}
this.mRoot.ibSearchInput.maxChars = 256;
this.mRoot.ibSearchInput.setStyle("fontFamily","Arial Unicode MS");
this.mRoot.ibSearchInput.setStyle("fontSize ",10);
this.mRoot.ibSearchInput.setStyle("borderStyle","solid");
this.mRoot.ibSearchInput.setStyle("borderColor",12566711);
this.mRoot.ibSearchInput.embedFonts = _global.gUseEmbeddedFont;
this.mRoot.ibExcludeWords.maxChars = 256;
this.mRoot.ibExcludeWords.setStyle("fontFamily","Arial Unicode MS");
this.mRoot.ibExcludeWords.setStyle("fontSize ",10);
this.mRoot.ibExcludeWords.setStyle("borderStyle","solid");
this.mRoot.ibExcludeWords.setStyle("borderColor",12566711);
this.mRoot.ibExcludeWords.embedFonts = _global.gUseEmbeddedFont;
if(_global.gUseEmbeddedFont)
{
this.mRoot.ibExcludeWords.setStyle("fontWeight","bold");
this.mRoot.ibSearchInput.setStyle("fontWeight","bold");
this.mRoot.ibExcludeWords.setStyle("fontColor","#444444");
this.mRoot.ibSearchInput.setStyle("fontColor","#444444");
}
this.mRoot.searchTypeGroup.addEventListener("click",mx.utils.Delegate.create(this,this.onSearchTypeChange));
this.mRoot.btnStartSearch.addEventListener("click",mx.utils.Delegate.create(this,this.onSearch));
this.mRoot.ibSearchInput.addEventListener("enter",mx.utils.Delegate.create(this,this.onSearch));
this.mRoot.mc_Preview.addEventListener("previewClick",mx.utils.Delegate.create(this,this.onPreviewClick));
this.mRoot.mc_TabMostra._visible = true;
this.mRoot.mc_TabMostra.useHandCursor = false;
this.mRoot.mc_TabMostra.onPress = function()
{
};
this.mRoot.mc_LemmaViewer.addEventListener("onXXIWindowMessage",mx.utils.Delegate.create(this,this.onHandleWindowMessage));
this.mRoot.mc_ContributiWindow.addEventListener("onXXIWindowMessage",mx.utils.Delegate.create(this,this.onHandleWindowMessage));
this.mRoot.mc_ProspettiveViewer.addEventListener("onXXIWindowMessage",mx.utils.Delegate.create(this,this.onHandleWindowMessage));
this.mRoot.mc_ZoomWindow.addEventListener("onXXIWindowMessage",mx.utils.Delegate.create(this,this.onHandleWindowMessage));
this.mRoot.mc_SearchResult.addEventListener("resultTabChange",mx.utils.Delegate.create(this,this.onResultTabChange));
}
function clearUI()
{
this.mRoot.mc_Preview.Hide();
this.mRoot.ibSearchInput.text = "";
this.mSearchData = this.GetSearchData();
this.mRoot.lblTitolo.text = "";
this.mRoot.ibExcludeWords.text = "";
}
function OpenContributiWindow(inContributo)
{
this.HistoryUpdate(inContributo,inContributo.mFrom);
this.CloseAllWindows();
this.mRoot.mc_ContributiWindow.MostraContributo(inContributo,inContributo.mFrom);
}
function OpenProspettiveWindow(inProspettiva, inFrom)
{
this.HistoryUpdate(inProspettiva,inProspettiva.mFrom);
this.CloseAllWindows();
this.mRoot.mc_ProspettiveViewer.MostraProspettiva(inProspettiva,inProspettiva.mFrom);
}
function OpenLemmaWindow(inLemma)
{
this.HistoryUpdate(inLemma,inLemma.mFrom);
this.CloseAllWindows();
this.mRoot.mc_LemmaViewer.MostraLemma(inLemma,inLemma.mFrom);
}
function OpenZoomWindow(inContributo, inFrom)
{
this.mRoot.mc_ZoomWindow.ZoomContributo(inContributo,inFrom);
}
function ZoomImage(inTile, inUrl)
{
this.mRoot.mc_ZoomWindow.ZoomImage(inTile,inUrl);
}
function ShowLemmaPreview(inLemma)
{
this.mRoot.mc_Preview.ShowText(inLemma.GetPreview());
}
function ShowContributiPreview(inContributo)
{
this.mRoot.mc_Preview.ShowImage(inContributo);
}
function ShowProspettivePreview(inProspettiva)
{
this.mRoot.mc_Preview.ShowImage(inProspettiva);
}
function CloseAllWindows()
{
this.mRoot.mc_ProspettiveViewer.Close();
this.mRoot.mc_ContributiWindow.Close();
this.mRoot.mc_LemmaViewer.Close();
this.mRoot.mc_DialogManager.Show(false);
this.mRoot.mc_MenuProspettive._visible = false;
}
function Back()
{
if(this.mTornaArray.length > 0)
{
var _loc2_ = this.mTornaArray.pop();
if(_loc2_.from == "ricerca")
{
this.InitSearch(false);
this.CloseAllWindows();
}
else if(_loc2_.from == "menuProspettive")
{
this.MenuProspettive(true);
}
else if(_loc2_.from == "prospettiva")
{
this.MostraProspettiva(_loc2_.id,_loc2_.tipo,_loc2_.titolo,"back_" + this.mTornaArray[this.mTornaArray.length - 1].from,true,_loc2_.status);
}
else if(_loc2_.from == "lemma")
{
this.MostraLemma(_loc2_.id,_loc2_.tipo,_loc2_.titolo,"back_" + this.mTornaArray[this.mTornaArray.length - 1].from,true,_loc2_.status);
}
else if(_loc2_.from == "contributo")
{
this.MostraContributo(_loc2_.id,_loc2_.tipo,_loc2_.titolo,"back_" + this.mTornaArray[this.mTornaArray.length - 1].from,true,_loc2_.status);
}
}
}
function HistoryUpdate(inObject, inFrom)
{
if(inFrom == "ricerca" || inFrom == "menuProspettive")
{
this.mTornaArray.push({from:inFrom,id:0,titolo:"",tipo:""});
}
else if(inFrom == "prospettiva")
{
this.mTornaArray.push({from:inFrom,id:this.mProspettiva.mId,titolo:this.mProspettiva.mTitolo,tipo:this.mProspettiva.mTipo,status:null});
}
else if(inFrom == "contributo")
{
this.mTornaArray.push({from:inFrom,id:this.mContributo.mId,titolo:this.mContributo.mTitolo,tipo:this.mContributo.mTipo,status:null});
}
else if(inFrom == "lemma")
{
this.mTornaArray.push({from:inFrom,id:this.mLemma.mId,titolo:this.mLemma.mTitolo,tipo:this.mLemma.mTipo,status:this.mRoot.mc_LemmaViewer.GetStatus()});
}
if(inFrom != "history" && inFrom.indexOf("back_") < 0)
{
this.mHistory.Add(inObject,inFrom);
this.mRoot.mc_toolbar.RefreshHistoryButton(this.mHistory);
}
this.mLastVisitedItem = {data:inObject,from:inFrom};
}
function HistoryBack()
{
this.HistoryGotoItem(this.mHistory.Back());
}
function HistoryNext()
{
this.HistoryGotoItem(this.mHistory.Forward());
}
function HistoryGoto(inPos)
{
this.HistoryGotoItem(this.mHistory.Goto(inPos));
}
function GetHistoryData(inPos)
{
return this.mHistory.GetData();
}
function HistoryGotoItem(historyItem)
{
if(historyItem)
{
if(historyItem.tipo == "L" || historyItem.tipo == "R")
{
this.mRoot.mc_ContributiWindow.Hide();
this.MostraLemma(historyItem.id,historyItem.tipo,historyItem.titolo,"history",true);
}
else if(historyItem.tipo == "P")
{
this.MostraProspettiva(historyItem.id,historyItem.tipo,historyItem.titolo,"history",true);
}
else
{
this.mRoot.mc_LemmaViewer.Hide();
this.MostraContributo(historyItem.id,historyItem.tipo,historyItem.titolo,"history",true);
}
this.mRoot.mc_toolbar.RefreshHistoryButton(this.mHistory);
}
}
function UpdateToolbarButton()
{
var _loc3_ = false;
var _loc2_ = false;
var _loc5_ = false;
if(this.mWhere == "contributi")
{
_loc2_ = false;
}
else if(this.mWhere == "prospettive" || this.mRoot.mc_MenuProspettive._visible == true)
{
_loc2_ = _loc3_ = false;
}
else if(this.mWhere == "lemma")
{
_loc2_ = _loc3_ = true;
}
else if(this.mSearchType != "mostra")
{
var _loc4_ = this.mRoot.mc_SearchResult.GetActiveTabList();
_loc2_ = _loc3_ = _loc4_.length > 0;
}
this.mRoot.mc_toolbar.EnableButton("cbtn_Copia",_loc3_);
this.mRoot.mc_toolbar.EnableButton("cbtn_Stampa",_loc2_);
}
function Copy(inWhat)
{
var _loc2_ = false;
if(this.mRoot.mc_ContributiWindow._visible == true)
{
this.mRoot.mc_ContributiWindow.Copy();
}
else if(this.mRoot.mc_LemmaViewer._visible == true)
{
_loc2_ = this.mRoot.mc_LemmaViewer.Copy(inWhat);
}
else if(this.mSearchType != "mostra")
{
this.mRoot.mc_SearchResult.Copy();
}
return _loc2_;
}
function Save(inWhat)
{
var _loc2_ = false;
if(this.mRoot.mc_ContributiWindow._visible == true)
{
this.mRoot.mc_ContributiWindow.Save();
}
else if(this.mRoot.mc_LemmaViewer._visible == true)
{
_loc2_ = this.mRoot.mc_LemmaViewer.Save(inWhat);
}
else if(this.mSearchType != "mostra")
{
this.mRoot.mc_SearchResult.Save();
}
return _loc2_;
}
function Print(inWhat)
{
var _loc2_ = false;
if(this.mRoot.mc_ContributiWindow._visible == true)
{
this.mRoot.mc_ContributiWindow.Print();
}
else if(this.mRoot.mc_LemmaViewer._visible == true)
{
_loc2_ = this.mRoot.mc_LemmaViewer.Print(inWhat);
}
else if(this.mSearchType != "mostra")
{
this.mRoot.mc_SearchResult.Print();
}
return _loc2_;
}
function ExportHtmlFile(inName, inCss, inHeader, inBody)
{
var _loc7_ = _root.gNormalize.Normalize(inName);
var _loc8_ = StringUtils.trim(_loc7_.text);
inName = inName.split("'").join("'");
inHeader = inHeader.split("'").join("'");
inBody = inBody.split("'").join("'");
if(_global.gDVD == true)
{
this.mService.DoHtmlExport(inName,inCss,inHeader,inBody);
}
else
{
_global.gHtmlExportClip.filename = _loc8_;
_global.gHtmlExportClip.css = inCss;
_global.gHtmlExportClip.header = inHeader;
_global.gHtmlExportClip.body = inBody;
_global.gHtmlExportClip.getURL(CAppendiceSearch.EXPORTHTML_URL,"_blank","POST");
}
}
function SetWhere(inWhere)
{
this.mWhere = inWhere;
}
function Aiuto()
{
if(this.mRoot.mc_DialogManager)
{
var _loc2_ = "MenuGenerale";
if(this.mRoot.mc_MenuProspettive._visible)
{
_loc2_ = "ProspettiveMenu";
}
else if(this.mRoot.mc_LemmaViewer._visible)
{
_loc2_ = "AppendiceVoce";
}
else if(this.mRoot.mc_ContributiWindow._visible)
{
_loc2_ = "AppendiceContributi";
}
else if(this.mRoot.mc_ProspettiveViewer._visible)
{
this.PausaMovie();
_loc2_ = "AppendiceProspettive";
}
else if(this.mSearchType != "mostra")
{
_loc2_ = "AppendiceCerca";
}
else
{
_loc2_ = "AppendiceLista";
}
this.mRoot.mc_DialogManager.LoadContents(CAppendiceSearch.HELP_URL,_loc2_,true);
}
}
function Crediti()
{
if(this.mRoot.mc_DialogManager)
{
this.PausaMovie();
this.mRoot.mc_DialogManager.LoadContents(CAppendiceSearch.CREDITS_URL,"",true);
}
}
function MenuProspettive(inInit)
{
this.CloseAllWindows();
if(inInit == true)
{
this.InitMenuProspettive();
}
this.mRoot.mc_MenuProspettive._visible = true;
this.SetWhere("menuProspettive");
this.UpdateToolbarButton();
}
function Ricerca()
{
this.CloseAllWindows();
this.InitSearch(false);
this.UpdateToolbarButton();
}
function onEsci()
{
this.PausaMovie();
var _loc4_ = "Si conferma di voler uscire dalla Settima Appendice della Enciclopedia Italiana di Scienze, Lettere ed Arti?";
var _loc3_ = new Array();
_global.gAlert.SetCallback("YES",this,"doEsci",_loc3_);
_global.gAlert.ShowAlert("",_loc4_,"YESNO",10);
}
function doEsci()
{
if(_global.gDVD == true)
{
this.mRoot.getURL("lingo: AppendiceEsci");
}
else
{
this.mRoot.getURL("javascript:AppendiceEsci();");
}
}
function onIconizza()
{
if(_global.gDebug)
{
setInterval(_root.CaricaLemmaDebug,200);
}
else
{
this.PausaMovie();
if(_global.gDVD == true)
{
this.mRoot.getURL("lingo: AppendiceIconizza");
}
}
}
function PausaMovie()
{
if(this.mRoot.mc_ProspettiveViewer._visible)
{
this.mRoot.mc_ProspettiveViewer.PauseMovie();
}
}
}